home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Educational / RasMol / Source / transfor.h < prev   
Encoding:
C/C++ Source or Header  |  1995-10-18  |  5.0 KB  |  228 lines

  1. /* transfor.h
  2.  * RasMol2 Molecular Graphics
  3.  * Roger Sayle, August 1995
  4.  * Version 2.6
  5.  */
  6.  
  7. #define GroupAttr       0x00
  8. #define ChainAttr       0x01
  9. #define TempAttr    0x02
  10. #define ChargeAttr      0x03
  11.  
  12. #define MaskColourFlag  0x01
  13. #define MaskRadiusFlag  0x02
  14. #define MaskBothFlag    0x03
  15.  
  16. #define RibColInside    0x01
  17. #define RibColOutside   0x02
  18. #define RibColBoth      0x03
  19.  
  20. #ifdef EIGHTBIT
  21. #define DefaultAmbient    0.6
  22. #define DefaultColDepth   16
  23. #else
  24. #define DefaultAmbient    0.2
  25. #define DefaultColDepth   32
  26. #endif
  27.  
  28.  
  29. #define MAXSHADE 32
  30. typedef struct { 
  31.         Long refcount;
  32.         unsigned char r;
  33.         unsigned char g;
  34.         unsigned char b;
  35.     } ShadeDesc;
  36.  
  37.  
  38. #ifdef IBMPC
  39. #define BackCol    0
  40. #define BoxCol     1
  41. #define LabelCol   2
  42. #define FirstCol   3
  43. #endif
  44.  
  45. #ifdef APPLEMAC
  46. #define BackCol    1
  47. #define BoxCol     2
  48. #define LabelCol   3
  49. #define FirstCol   4
  50. #endif
  51.  
  52. #if !defined(IBMPC) && !defined(APPLEMAC)
  53. #define BackCol    5
  54. #define BoxCol     6
  55. #define LabelCol   7
  56. #define FirstCol   8
  57. #endif
  58.  
  59. #define Colour2Shade(x)  ((int)((x)-FirstCol)/ColourDepth)
  60. #define Shade2Colour(x)  ((x)*ColourDepth+FirstCol)
  61.  
  62.  
  63. #ifdef TRANSFORM
  64. ShadeDesc Shade[MAXSHADE];
  65. Real RotX[3],RotY[3],RotZ[3];
  66. Real MatX[3],MatY[3],MatZ[3];
  67. Real InvX[3],InvY[3],InvZ[3];
  68. Long OrigCX,OrigCY,OrigCZ;
  69. Long CenX, CenY, CenZ;
  70.  
  71. Real Ambient;
  72. Real Scale,MaxZoom;
  73. Real DScale,IScale;
  74. Long SideLen,Offset;
  75. Card WorldRadius,WorldSize;
  76. int XOffset,YOffset,ZOffset;
  77. int FakeSpecular,SpecPower;
  78. int ColourDepth,ColourMask;
  79. int BackR,BackG,BackB;
  80. int LabR,LabG,LabB;
  81. int BoxR,BoxG,BoxB;
  82. int UseLabelCol;
  83. int UseScreenClip;
  84. int ZoomRange;
  85.  
  86. int Hydrogens,HetaGroups;
  87. int DrawAtoms,MaxAtomRadius;
  88. int DrawBonds,MaxBondRadius;
  89. int DrawRibbon;
  90. int ZoneBoth;
  91.  
  92. #else
  93. extern ShadeDesc Shade[MAXSHADE];
  94. extern Real RotX[3],RotY[3],RotZ[3];
  95. extern Real MatX[3],MatY[3],MatZ[3];
  96. extern Real InvX[3],InvY[3],InvZ[3];
  97. extern Long OrigCX, OrigCY, OrigCZ;
  98. extern Long CenX, CenY, CenZ;
  99.  
  100. extern Real Ambient;
  101. extern Real Scale,MaxZoom;
  102. extern Real DScale,IScale;
  103. extern Long SideLen,Offset;
  104. extern Card WorldRadius,WorldSize;
  105. extern int XOffset,YOffset,ZOffset;
  106. extern int ColourDepth,ColourMask;
  107. extern int FakeSpecular,SpecPower;
  108. extern int BackR,BackG,BackB;
  109. extern int LabR,LabG,LabB;
  110. extern int BoxR,BoxG,BoxB;
  111. extern int UseLabelCol;
  112. extern int UseScreenClip;
  113. extern int ZoomRange;
  114.  
  115. extern int Hydrogens,HetaGroups;
  116. extern int DrawAtoms,MaxAtomRadius;
  117. extern int DrawBonds,MaxBondRadius;
  118. extern int DrawRibbon;
  119. extern int ZoneBoth;
  120.  
  121. #ifdef FUNCPROTO
  122. void SetRadiusValue( int );
  123. void SetRadiusTemperature();
  124. void SetVanWaalRadius();
  125. void DisableSpacefill();
  126. void SetHBondStatus( int, int, int );
  127. void SetRibbonStatus( int, int, int );
  128. void SetRibbonCartoons();
  129. void EnableWireframe( int, int );
  130. void EnableBackbone( int, int );
  131. void DisableWireframe();
  132. void DisableBackbone();
  133.  
  134. void SelectZoneExpr( Expr* );
  135. void RestrictZoneExpr( Expr* );
  136. void RestrictZone( int );
  137. void SelectZone( int );
  138.  
  139. int IsCPKColour( Atom __far * );
  140. int IsVDWRadius( Atom __far * );
  141.  
  142. void DefineColourMap();
  143. void ResetColourMap();
  144. void ColourBackNone();
  145. void ColourBondNone();
  146. void ColourHBondType();
  147. void ColourHBondNone( int );
  148. void ColourRibbonNone( int );
  149. void ColourMonitNone();
  150. void ColourBackAttrib( int, int, int );
  151. void ColourBondAttrib( int, int, int );
  152. void ColourHBondAttrib( int, int, int, int );
  153. void ColourRibbonAttrib( int, int, int, int );
  154. void ColourMonitAttrib( int, int, int );
  155. void ColourDotsAttrib( int, int, int );
  156. void ColourDotsPotential();
  157. void MonoColourAttrib( int, int, int );
  158. void ScaleColourAttrib( int );
  159. void CPKColourAttrib();
  160. void AminoColourAttrib();
  161. void ShapelyColourAttrib();
  162. void StructColourAttrib();
  163. void UserMaskAttrib( int );
  164.  
  165. void DetermineClipping();
  166. void InitialiseTransform();
  167. void InitialTransform();
  168. void PrepareTransform();
  169. void ReviseInvMatrix();
  170. void ApplyTransform();
  171. void ResetTransform();
  172.  
  173. #else /* non-ANSI C compiler */
  174. void SetRadiusValue();
  175. void SetRadiusTemperature();
  176. void SetVanWaalRadius();
  177. void DisableSpacefill();
  178. void SetHBondStatus();
  179. void SetRibbonStatus();
  180. void SetRibbonCartoons();
  181. void EnableWireframe();
  182. void EnableBackbone();
  183. void DisableWireframe();
  184. void DisableBackbone();
  185.  
  186. void SelectZoneExpr();
  187. void RestrictZoneExpr();
  188. void RestrictZone();
  189. void SelectZone();
  190.  
  191. int IsCPKColour();
  192. int IsVDWRadius();
  193.  
  194. void DefineColourMap();
  195. void ResetColourMap();
  196. void ColourBackNone();
  197. void ColourBondNone();
  198. void ColourHBondType();
  199. void ColourHBondNone();
  200. void ColourRibbonNone();
  201. void ColourMonitNone();
  202. void ColourBackAttrib();
  203. void ColourBondAttrib();
  204. void ColourHBondAttrib();
  205. void ColourRibbonAttrib();
  206. void ColourMonitAttrib();
  207. void ColourDotsAttrib();
  208. void ColourDotsPotential();
  209. void MonoColourAttrib();
  210. void ScaleColourAttrib();
  211. void CPKColourAttrib();
  212. void AminoColourAttrib();
  213. void ShapelyColourAttrib();
  214. void StructColourAttrib();
  215. void UserMaskAttrib();
  216.  
  217. void DetermineClipping();
  218. void InitialiseTransform();
  219. void InitialTransform();
  220. void PrepareTransform();
  221. void ReviseInvMatrix();
  222. void ApplyTransform();
  223. void ResetTransform();
  224.  
  225. #endif
  226. #endif
  227.  
  228.